package enemies
{
	import flash.geom.Point;
	
	public class Ferret extends Enemy
	{
		var speed = 3;
		public function Ferret(gH:GameHandler)
		{
			super(gH);
			game_handler = gH;
		}
		
		public function run(){
			move_towards_castle();
		}
		public function move_towards_castle(){
			var dir:Point = get_direction_of_castle();
			this.x += dir.x * speed;
			this.y += dir.y * speed;
			
			if(this.hitTestObject(game_handler.player_castle))
				speed = 0;
		}
		override public function hit(type,amt){
			hp -= amt;
			if(hp <= 0)
				die();
		}
	}
}